package com.kaishengit.dao;


import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.kaishengit.pojo.Idea;
import com.kaishengit.pojo.Ideacomment;

@Repository
public class IdeacommentDao extends BaseDao<Ideacomment,Integer>{

	@SuppressWarnings("unchecked")
	public List<Ideacomment> findByIdeaId(Idea idea) {
		Query query = getSession().createQuery("from Ideacomment where idea=:idea order by createtime desc");
		query.setParameter("idea", idea);
		return query.list();	
	}

}
